<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="TrailPhotos.aspx.cs" Inherits="UI_TrailPhotos" %>
<%@ Register Assembly="FUA" Namespace="Subgurim.Controles" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script language="javascript" type="text/javascript">
    function ShowDelete(divImg)
    {
        var divDelete = document.getElementById(divImg.id.replace('divImg', 'divDelete'));
        divDelete.style.display = '';    
        
    }
    
    function HideDelete(divImg)
    {
        var divDelete = document.getElementById(divImg.id.replace('divImg', 'divDelete'));
        divDelete.style.display = 'none';    
    }
</script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div style="padding:20px;"><table width="100%" border="0" cellpadding="5" cellspacing="0">
    <tr>
        <td width="50%" align="left" style="padding-left:20px;" valign="top">
            
            <cc1:FileUploaderAJAX ID="fu" runat="server" />
             <br />   
             <a id="Subgurim_fuAdd" onclick="Subgurim_fuadd('1', '4')" href="javascript:void(0)" class="links" style="">Add Photo</a>
            <br />
            <br />
            <%--<asp:Button ID="btnRefresh" runat="server" Text="Refresh" CssClass="form_btn" onclick="btnRefresh_Click" />--%>
            &nbsp;
            &nbsp;
            <asp:Button ID="btnFlickr" runat="server" Text="Import Form Flickr" 
                CssClass="form_btn" onclick="btnFlickr_Click" />            
            <br />
            <br />
            <asp:HyperLink ID="hlBack" NavigateUrl="~/UI/trail-details.aspx" CssClass="form_btn" runat="server">Back</asp:HyperLink>
            <br />
            <p></p>
            <p><asp:Literal ID="ltWaypoints" runat="server" Text="Select waypoint to assign image"/></p>
            <p></p>
            <asp:DropDownList ID="ddlWaypoins" runat="server">
            </asp:DropDownList>
        </td>
        <td width="50%" align="center"><%--DataSourceID="lnqImages" --%>
            <asp:DataList ID="dlImages" runat="server" RepeatColumns="3" BorderWidth="2" 
                CellSpacing="5" CellPadding="3" Width="100%" ItemStyle-HorizontalAlign="Center" 
                RepeatDirection="Horizontal" 
                onitemcommand="dlImages_ItemCommand">
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                <ItemTemplate>
                <div id="divImg" class="gallery_div" runat="server" style="position:relative;" onmouseover="ShowDelete(this);" onmouseout="HideDelete(this);">
                    <div >
                    <%--<a href='<%# Eval("ImageName","../Upload/Trail/{0}") %>'>--%>
                    <asp:Image ID="img" CssClass="gallery_image" Width="150" Height="170" 
                    ImageUrl='<%# Eval("Url")%>'
                    runat="server" />
                    </a>
                    <asp:HiddenField ID="hfID" runat="server" Value='<%# Eval("Id") %>' />
                    <asp:HiddenField ID="hfWpID" runat="server" Value='<%# Eval("WaypointId") %>' />
                    </div>
                    <div >
                        <asp:LinkButton ID="lbDelete" CommandArgument='<%# Eval("Id") %>' CommandName="Delete"
                            OnClientClick="return confirm('Are you Sure to delete this Photo?');"  CssClass="links"
                            runat="server" >Delete</asp:LinkButton>
                    </div>
                    
                    
                </div>
                </ItemTemplate>                
            </asp:DataList>
            <%--<asp:LinqDataSource ID="lnqImages" runat="server" 
                ContextTypeName="GeoCoding.BL.dbTrailInfoDataContext" 
                Select="new (ImageName, Id)" TableName="TrailImages" 
                Where="TrailId == @TrailId">
                <WhereParameters>
                    <asp:QueryStringParameter DefaultValue="0" Name="TrailId" 
                        QueryStringField="TrailID" Type="Int32" />
                </WhereParameters>
            </asp:LinqDataSource>--%>
        </td>
    </tr>
</table>
</div>


</asp:Content>

